#! /bin/sh

start() {
	now=`date "+%Y%m%d"`
    exec java -Xms256m -Xmx2048m -jar mts.da-1.0.jar 5 >> log/server.log &
    printf 'Start server, see details in log/server.log \n'
    #tail -f log/server.log
}

stop(){
    ps -ef|grep java|awk '{print $2}'|while read pid
    do
        kill -9 $pid
    done
}

case "$1" in
	start)
	start
	;;
	stop)
	stop
	;;
	restart)
	stop start
	;;
*)
printf 'Usage: %s {start|stop|restart}\n' "$prog"
exit 1
;;
esac
